package com.wjj.happytime.adapter.listen_frg_adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;
import com.wjj.happytime.fragment.listen_frg.ProvinceRadioFrg;
import java.util.ArrayList;
import java.util.LinkedList;

/**
 * Created by junjie.wang on 2017/4/25.
 */

public class ProvinceRadioVPAdapter extends FragmentStatePagerAdapter {

  public ArrayList<String> tabNames;
  public LinkedList<ProvinceRadioFrg> frgs;

  public ProvinceRadioVPAdapter(FragmentManager fm) {
    super(fm);
  }

  public ProvinceRadioVPAdapter(FragmentManager fm, ArrayList<String> tabNames,
      LinkedList<ProvinceRadioFrg> frgs) {
    super(fm);
    this.tabNames = tabNames;
    this.frgs = frgs;
  }

  @Override
  public Fragment getItem(int position) {
    return frgs.get(position);
  }

  @Override
  public int getCount() {
    return frgs.size();
  }

  @Override
  public CharSequence getPageTitle(int position) {
    return tabNames.get(position);
  }
}
